home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CappuccinoSI.cpp
-
- Contains: Implementation of Mac-specific CappuccinoSI class.
-
- Written by: Troy Gaul (from SemtIntf.cpp by Nick Pilch)
-
- Copyright: © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
- */
-
-
- #ifndef _EXCEPT_
- #include "Except.h"
- #endif
-
- #define VARIABLE_MACROS
- #define CappuccinoSI_Class_Source
- #include <CappuccinoSI.xih>
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::somInit
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSIsomInit(CappuccinoSI *somSelf)
- {
- // CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSIsomInit");
-
- CappuccinoSI_parents_somInit(somSelf);
-
- /* _fHelper = kODNULL; */ // som initializes fields to NULL.
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::InitCPlusSemanticInterface
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSIInitCPlusSemanticInterface(CappuccinoSI *somSelf, Environment *ev,
- ODPart* base,
- SIHelperAbs* helper,
- ODSession* session)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSIInitCPlusSemanticInterface");
-
- SOM_TRY
- somSelf->InitSemanticInterface(ev, base, session);
- SOM_CATCH_ALL
- SOM_ENDTRY
-
- _fHelper = helper;
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::somUninit
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSIsomUninit(CappuccinoSI *somSelf)
- {
- // CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSIsomUninit");
-
- CappuccinoSI_parents_somUninit(somSelf);
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::GetSIHelper
- //------------------------------------------------------------------------------
-
- SOM_Scope SIHelperAbs* SOMLINK CappuccinoSIGetSIHelper(CappuccinoSI *somSelf, Environment *ev)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSIGetSIHelper");
-
- return _fHelper;
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallEventHandler
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallEventHandler(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODAppleEvent* theODAppleEvent,
- ODAppleEvent* reply)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallEventHandler");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallEventHandler((ODPart*)somSelf->GetBase(ev),
- theODAppleEvent, reply);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallCoercionHandler
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallCoercionHandler(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODDesc* theODDesc,
- ODDescType toType,
- ODDesc* result)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallCoercionHandler");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallCoercionHandler((ODPart*)somSelf->GetBase(ev),
- theODDesc, toType, result);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallObjectAccessor
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallObjectAccessor(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODDescType desiredClass,
- ODOSLToken* container,
- ODDescType containerClass,
- ODDescType form,
- ODDesc* selectionData,
- ODOSLToken* value)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallObjectAccessor");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallObjectAccessor((ODPart*)somSelf->GetBase(ev),
- desiredClass, container,
- containerClass, form,
- selectionData, value);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallPredispatchProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallPredispatchProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODAppleEvent* theODAppleEvent,
- ODAppleEvent* reply)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallPredispatchProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallPredispatchProc((ODPart*)somSelf->GetBase(ev),
- theODAppleEvent, reply);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallCompareProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallCompareProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODDescType oper,
- ODOSLToken* obj1,
- ODOSLToken* obj2,
- ODBoolean* result)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallCompareProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallCompareProc((ODPart*)somSelf->GetBase(ev), oper,
- obj1, obj2, result);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallCountProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallCountProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODDescType desiredType,
- ODDescType containerClass,
- ODOSLToken* container,
- ODSLong* result)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallCountProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallCountProc((ODPart*)somSelf->GetBase(ev),
- desiredType, containerClass,
- container, result);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallDisposeTokenProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallDisposeTokenProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODOSLToken* unneededToken)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallDisposeTokenProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallDisposeTokenProc((ODPart*)somSelf->GetBase(ev),
- unneededToken);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallGetErrDescProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallGetErrDescProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODDesc** errDesc)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallGetErrDescProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallGetErrDescProc((ODPart*)somSelf->GetBase(ev),
- errDesc);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallGetMarkTokenProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallGetMarkTokenProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODOSLToken* dContainerToken,
- ODDescType containerClass,
- ODOSLToken* result)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallGetMarkTokenProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallGetMarkTokenProc((ODPart*)somSelf->GetBase(ev),
- dContainerToken,
- containerClass, result);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallMarkProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallMarkProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODOSLToken* dToken,
- ODOSLToken* markToken,
- ODSLong index)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallMarkProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallMarkProc((ODPart*)somSelf->GetBase(ev), dToken,
- markToken, index);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // CappuccinoSI::CallAdjustMarksProc
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK CappuccinoSICallAdjustMarksProc(CappuccinoSI *somSelf, Environment *ev,
- ODPart* thePart,
- ODSLong newStart,
- ODSLong newStop,
- ODOSLToken* markToken)
- {
- CappuccinoSIData *somThis = CappuccinoSIGetData(somSelf);
- CappuccinoSIMethodDebug("CappuccinoSI","CappuccinoSICallAdjustMarksProc");
-
- OSErr error;
- SOM_TRY
- somSelf->CheckValid(ev);
- error = _fHelper->CallAdjustMarksProc((ODPart*)somSelf->GetBase(ev),
- newStart, newStop, markToken);
- THROW_IF_ERROR(error);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
-